import { createRouter, createWebHistory } from 'vue-router';
import Home from '../views/HomeView.vue';
import Product from '../views/ProductView.vue';
import Help from '../views/HelpView.vue';
import About from '../views/AboutView.vue';
import QuestionView from "@/views/QuestionView.vue";
import ArticleView from "@/views/ArticleView.vue";

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home,
    },
    {
        path: '/product/:id?',
        name: 'Product',
        component: Product,
    },
    {
        path: '/help',
        // name: 'Help',
        // component: Help,
        children: [
            {
                path: '',
                name: 'Help',
                component: Help,
            },
            {
                path: 'question/:id?',
                name: 'Question',
                component: QuestionView
            },
            {
                path: 'article/:id?',
                name: 'Article',
                component: ArticleView,
            }
        ]
    },
    {
        path: '/about',
        name: 'About',
        component: About,
    },
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
